<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.io.*" %>
<%@ page import="com.itrus.util.sign.*" %>
<%@ page import="com.vo.Gateway" %>
<%@ page import="com.pay.yeepay.server.Configuration" %>


<%
//////////////////////////////////// 请求参数 //////////////////////////////////////
		
	// 接收表单提交参数
		request.setCharacterEncoding("UTF-8");
		
		String notify_url = (String)request.getAttribute("notify_url");
		String order_no = (String)request.getAttribute("order_no");		
		String order_time = (String)request.getAttribute("order_time");		
		String order_amount = (String)request.getAttribute("order_amount");		
		String product_name = (String)request.getAttribute("product_name");		
		String client_ip = (String)request.getAttribute("client_ip");		
		String merchant_code = (String)request.getAttribute("merchant_code");	
		String sign_type = (String)request.getAttribute("sign_type");	
		String merchant_private_key = (String)request.getAttribute("merchant_private_key");	
		String service_type = (String)request.getAttribute("service_type");	
		String interface_version = (String)request.getAttribute("interface_version");	
		String pay_key = (String)request.getAttribute("pay_key");	
		String yzxmallUrl = Configuration
				.getInstance().getValue("yzxmallUrl"); // 交易请求地址头信息

		StringBuffer signSrc= new StringBuffer();	
		signSrc.append("client_ip=").append(client_ip).append("&");	
		signSrc.append("interface_version=").append(interface_version).append("&");
		signSrc.append("merchant_code=").append(merchant_code).append("&");				
		signSrc.append("notify_url=").append(notify_url).append("&");	
		signSrc.append("order_amount=").append(order_amount).append("&");
		signSrc.append("order_no=").append(order_no).append("&");
		signSrc.append("order_time=").append(order_time).append("&");
		signSrc.append("product_name=").append(product_name).append("&");
		signSrc.append("service_type=").append(service_type);		
		
		String signInfo = signSrc.toString();
		String sign = RSAWithSoftware.signByPrivateKey(signInfo,merchant_private_key) ;  
		System.out.println("RSA-S商家发送的签名字符串：" + signInfo.length() + " -->" + signInfo);
		System.out.println("RSA-S商家发送的签名：" + sign.length() + " -->" + sign + "\n");
		
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
</head>
<body onLoad="document.dinpayForm.submit();">
  <form name="dinpayForm" method="post" action="<%=yzxmallUrl%>/dinpay/qrcode" >
	
		<input type="hidden" name="sign" value="<%=sign%>" />
	<input type="hidden" name="merchant_code" value="<%=merchant_code%>" />
	<input type="hidden" name="service_type" value="<%=service_type%>" />	
	<input type="hidden" name="interface_version" value="<%=interface_version%>" />			
	<input type="hidden" name="notify_url" value="<%=notify_url%>"/>
	<input type="hidden" name="sign_type" value="<%=sign_type%>" />		
	<input type="hidden" name="order_no" value="<%=order_no%>"/>
	<input type="hidden" name="order_time" value="<%=order_time%>" />	
	<input type="hidden" name="order_amount" value="<%=order_amount%>"/>
	<input type="hidden" name="product_name" value="<%=product_name%>" />	
	<input type="hidden" name="client_ip" value="<%=client_ip%>" />	
	<input type="hidden" name="pay_key" value="<%=pay_key%>"/>
  </form>
</body>
</html>
